package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author: liull
 * @Description: 求立方根 不使用库函数
 * @Date: Created in 15:08 2020/3/24
 * @Modified By:
 */
public class Main21 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        double value = Double.parseDouble(s);
        System.out.printf("%.1f", getCubeRoot(value));

    }

    /*
     *功能: 计算一个数字的立方根
     *输入:double input 待求解参数
     *返回值:double	输入参数的立方根
     */
    //    public static double getCubeRoot(double input) {
    //        /*在这里实现功能*/
    //        if (input == 0) {
    //            return 0;
    //        }
    //        double x0, x1;
    //        x0 = input;
    //        x1 = (2 * x0 + input / x0 / x0) / 3;//利用迭代法求解
    //        while (Math.abs(x1 - x0) > 0.000001) {
    //            x0 = x1;
    //            x1 = (2 * x0 + input / x0 / x0) / 3;
    //        }
    //        return x1;
    //    }
    public static double getCubeRoot(double input) {
        double max = input;
        double min = 0;
        double mid = 0;
        //二分查找
        while (max - min > 0.001)  //加一个精度
        {
            mid = (max + min) / 2;
            if (mid * mid * mid >= input) {
                max = mid;
            } else {
                min = mid;
            }
        }
        return mid;
    }
}
